home *** CD-ROM | disk | FTP | other *** search
/ Aminet 3 / Aminet 3 - July 1994.iso / Aminet / dev / obero / Interfaces3_4.lha / Interfaces / Expansion.mod < prev    next >
Text File  |  1994-03-05  |  6KB  |  138 lines

  1. (*
  2. (*
  3. **  Amiga Oberon Interface Module:
  4. **  $VER: Expansion.mod 40.15 (28.12.93) Oberon 3.0
  5. **
  6. **   © 1993 by Fridtjof Siebert
  7. *)
  8. *)
  9.  
  10. MODULE Expansion;
  11.  
  12. IMPORT
  13.   e * := Exec,
  14.   d * := Dos,
  15.   c * := Config;
  16.  
  17. CONST
  18.   expansionName * = "expansion.library";
  19.  
  20. (* flags for the AddDosNode() call *)
  21.   startProc * = 0;
  22.  
  23. TYPE
  24.  
  25. (* BootNodes are scanned by dos.library at startup.  Items found on the
  26.    list are started by dos. BootNodes are added with the AddDosNode() or
  27.    the V36 AddBootNode() calls. *)
  28.  
  29.   BootNodePtr * = UNTRACED POINTER TO BootNode;
  30.   BootNode * = STRUCT (node* : e.Node)
  31.     flags * : SET;
  32.     deviceNode* : e.NodePtr;
  33.   END;
  34.  
  35.  
  36. (* expansion.library has functions to manipulate most of the information in
  37.    ExpansionBase.  Direct access is not permitted.  Use FindConfigDev()
  38.    to scan the board list. *)
  39.  
  40.   ExpansionBasePtr * = UNTRACED POINTER TO ExpansionBase;
  41.   ExpansionBase * = STRUCT (libNode * : e.Library)
  42.     flags     - : SHORTSET;         (* read only (see below) *)
  43.     private01   : e.BYTE;           (* private *)
  44.     private02   : LONGINT;          (* private *)
  45.     private03   : LONGINT;          (* private *)
  46.     private04   : c.CurrentBinding; (* private *)
  47.     private05   : e.List;           (* private *)
  48.     mountList * : e.List;           (* contains struct BootNode entries *)
  49.     (* private *)
  50.   END;
  51.  
  52. CONST
  53.  
  54. (* error codes *)
  55.   ok          * = 0;
  56.   lastBoard   * = 40;  (* could not shut him up *)
  57.   noExpansion * = 41;  (* not enough expansion mem; board shut up *)
  58.   noMemory    * = 42;  (* not enough normal memory *)
  59.   noBoard     * = 43;  (* no board at that address *)
  60.   badMem      * = 44;  (* tried to add bad memory card *)
  61.  
  62. (* Flags *)
  63.   ebClogged    * = 0;       (* someone could not be shutup *)
  64.   ebShortMem   * = 1;       (* ran out of expansion mem *)
  65.   ebBadMem     * = 2;       (* tried to add bad memory card *)
  66.   ebDosFlag    * = 3;       (* reserved for use by AmigaDOS *)
  67.   ebKickBack33 * = 4;       (* reserved for use by AmigaDOS *)
  68.   ebKickBack36 * = 5;       (* reserved for use by AmigaDOS *)
  69. (* If the following flag is set by a floppy's bootblock code, the initial
  70.    open of the initial shell window will be delayed until the first output
  71.    to that shell.  Otherwise the 1.3 compatible behavior applies. *)
  72.   ebSilentStart* = 6;
  73.  
  74.  
  75. VAR
  76.   base * : ExpansionBasePtr;
  77.  
  78. (*--- functions in V33 or higher (Release 1.2) ---*)
  79. PROCEDURE AddConfigDev        *{base,- 30}(configDev{8}      : c.ConfigDevPtr);
  80. (* ---   functions in V36 or higher  (Release 2.0)   --- *)
  81. (* --- REMEMBER: You are to check the version BEFORE you use this ! --- *)
  82. PROCEDURE AddBootNode         *{base,- 36}(bootPri{0}        : LONGINT;
  83.                                            flags{1}          : LONGSET;
  84.                                            deviceNode{8}     : d.DeviceNodePtr;
  85.                                            configDev{9}      : c.ConfigDevPtr): BOOLEAN;
  86. (*--- functions in V33 or higher (Release 1.2) ---*)
  87. PROCEDURE AllocBoardMem       *{base,- 42}(slotSpec{0}       : LONGINT);
  88. PROCEDURE AllocConfigDev      *{base,- 48}(): c.ConfigDevPtr;
  89. PROCEDURE AllocExpansionMem   *{base,- 54}(numSlots{0}       : LONGINT;
  90.                                            slotAlign{1}      : LONGINT): e.APTR;
  91. PROCEDURE ConfigBoard         *{base,- 60}(board{8}          : e.APTR;
  92.                                            configDev{9}      : c.ConfigDevPtr);
  93. PROCEDURE ConfigChain         *{base,- 66}(baseAddr{8}       : e.APTR);
  94. PROCEDURE FindConfigDev       *{base,- 72}(oldConfigDev{8}   : c.ConfigDevPtr;
  95.                                            manufacturer{0}   : LONGINT;
  96.                                            product{1}        : LONGINT): c.ConfigDevPtr;
  97. PROCEDURE FreeBoardMem        *{base,- 78}(startSlot{0}      : LONGINT;
  98.                                            slotSepc{1}       : LONGINT);
  99. PROCEDURE FreeConfigDev       *{base,- 84}(configDev{8}      : c.ConfigDevPtr);
  100. PROCEDURE FreeExpansionMem    *{base,- 90}(startSlot{0}      : LONGINT;
  101.                                            numSlots{1}       : LONGINT);
  102. PROCEDURE ReadExpansionByte   *{base,- 96}(board{8}          : e.APTR;
  103.                                            offset{0}         : LONGINT): e.BYTE;
  104. PROCEDURE ReadExpansionRom    *{base,-102}(board{8}          : e.APTR;
  105.                                            configDev{9}      : c.ConfigDevPtr);
  106. PROCEDURE RemConfigDev        *{base,-108}(configDev{8}      : c.ConfigDevPtr);
  107. PROCEDURE WriteExpansionByte  *{base,-114}(board{8}          : e.APTR;
  108.                                            offset{0}         : LONGINT;
  109.                                            byte{1}           : e.BYTE);
  110. PROCEDURE ObtainConfigBinding *{base,-120}();
  111. PROCEDURE ReleaseConfigBinding*{base,-126}();
  112. PROCEDURE SetCurrentBinding   *{base,-132}(currentBinding{8} : c.CurrentBindingPtr;
  113.                                            size{0}           : LONGINT);
  114. PROCEDURE GetCurrentBinding   *{base,-138}(currentBinding{8} : c.CurrentBindingPtr;
  115.                                            bindingSize{0}    : LONGINT): LONGINT;
  116. PROCEDURE MakeDosNode         *{base,-144}(parmPacket{8}     : e.APTR): d.DeviceNodePtr;
  117. PROCEDURE AddDosNode          *{base,-150}(bootPri{0}        : LONGINT;
  118.                                            flags{1}          : LONGSET;
  119.                                            deviceNode{8}     : d.DeviceNodePtr): BOOLEAN;
  120. (* ---   functions in V36 or higher  (Release 2.0)   --- *)
  121. (* --- REMEMBER: You are to check the version BEFORE you use this ! --- *)
  122. PROCEDURE ExpansionResrved26  *{base,-156}();
  123. PROCEDURE WriteExpansionWord  *{base,-162}(board{8}          : e.APTR;
  124.                                            offset{0}         : LONGINT;
  125.                                            word{1}           : INTEGER);
  126.  
  127. (* $OvflChk- $RangeChk- $StackChk- $NilChk- $ReturnChk- $CaseChk- *)
  128.  
  129. BEGIN
  130.   base :=   e.OpenLibrary(expansionName,33);
  131.   IF base = NIL THEN HALT(d.fail) END;
  132.  
  133. CLOSE
  134.   IF base#NIL THEN e.CloseLibrary(base) END;
  135.  
  136. END Expansion.
  137.  
  138.